﻿#include "KuGouApiSource1.h"



QString KuGouApiSource1::searchSongs
(const QString& keyword
	, int page
	, int pageSize)
{
	return QString(
		"http://mobilecdn.kugou.com/api/v3/search/song?format=json&"
		"keyword=%1"
		"&page=%2"
		"&pagesize=%3&showtype=1"
	).arg(keyword).arg(page).arg(pageSize);
} 



QString KuGouApiSource1::getMusic(const QString& musicHash)
{
	return QString("https://m.kugou.com/app/i/getSongInfo.php?cmd=playInfo&hash=%1").arg(musicHash);
}

QString KuGouApiSource1::searchMvUrl(const QString& keyword, int page, int pageSize)
{
	return searchSongs(keyword,page,pageSize);
}

QString KuGouApiSource1::mvUrl(const QString& mvHash)
{
	return QString("http://m.kugou.com/app/i/mv.php?cmd=100"
	"&hash=%1&ismp3=1&ext=mp4").arg(mvHash);
}

QString KuGouApiSource1::searchLyrics(const QString& songName, int duration_ms)
{
	return QString("http://lyrics.kugou.com/search?ver=1&man=yes&client=pc&"
		"keyword=%1&duration=%2").arg(songName).arg(duration_ms);
}

QString KuGouApiSource1::searchLyrics(const QString& songName, int duration_ms, const QString& musicHash)
{
	return QString("http://lyrics.kugou.com/search?ver=1&man=yes&client=pc&"
		"keyword=%1&duration=%2&hash=%3"
	).arg(songName).arg(duration_ms).arg(musicHash);
}

QString KuGouApiSource1::getLyrics(const QString& id, const QString& accessKey)
{
	return QString("http://lyrics.kugou.com/download?ver=1&client=pc&"
		"id=%1&accesskey=%2&fmt=lrc&charset=utf8").arg(id).arg(accessKey);
}

KuGouApiSource1::~KuGouApiSource1()
{
}
